package com.hqshuke.exchange.system.controller;




import com.hqshuke.exchange.instrument.dto.TestDto;
import com.hqshuke.exchange.instrument.feignClient.InstrumentClient;
import com.hqshuke.exchange.system.service.MainService;
import com.hqshuke.exchange.system.dto.DemoDto;
import com.hqshuke.exchange.system.vo.DemoVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/main")
@Tag(description = "system", name = "交易拍卖公共服务系统")
@AllArgsConstructor
public class MainController {

    @Autowired
    private MainService mainService;

    private final InstrumentClient instrumentClient;

    @GetMapping("/test/get")
    @Operation(summary = "get测试")
    public DemoVo test(DemoDto dto){
        return mainService.testService(dto.getRequestMsg());
    }


    @PostMapping("/test/post")
    @Operation(summary = "post测试")
    public DemoVo postTest(@RequestBody DemoDto dto){
        return mainService.testService(dto.getRequestMsg());
    }

    @GetMapping("/remote")
    @Operation(summary = "get测试")
    public String testRemote(TestDto testDto){
        return instrumentClient.testRemote(testDto);
    }

}
